import { del, get, post } from "@/utils/request";
import { addData, nightAddParams, type nightListReturn, type nightParams } from "./type";

// 夜巡列表
export const patrolList = (data: nightParams) => {
  return get<nightParams, nightListReturn>("/api/patrol/list", data);
};

// 夜巡添加
export const patrolAdd = (data: nightAddParams) => {
  return post<nightAddParams, addData>("/api/patrol/add", data);
};

// 删除
export const patrolDel = (id: number) => {
  return del<null, null>(`/api/patrol/delete/${id}`);
};

// 批删
export const patrolDelAll = (data: number[]) => {
  return post<number[], null>("/api/patrol/deleteAll", data);
};
